package org.rsbot.script.wrappers;

public class RSTile
{
  private final int x;
  private final int y;
  private final int z;

  public RSTile(int paramInt1, int paramInt2)
  {
    this.x = paramInt1;
    this.y = paramInt2;
    this.z = 0;
  }

  public RSTile(int paramInt1, int paramInt2, int paramInt3)
  {
    this.x = paramInt1;
    this.y = paramInt2;
    this.z = paramInt3;
  }

  public int getX() {
    return this.x;
  }

  public int getY() {
    return this.y;
  }

  public int getZ() {
    return this.z;
  }

  public RSTile randomize(int paramInt1, int paramInt2)
  {
    int i = getX();
    int j = getY();
    double d;
    if (paramInt1 > 0) {
      d = Math.random() * 2.0D - 1.0D;
      d *= paramInt1;
      i += (int)d;
    }
    if (paramInt2 > 0) {
      d = Math.random() * 2.0D - 1.0D;
      d *= paramInt2;
      j += (int)d;
    }
    return new RSTile(i, j);
  }

  public int hashCode()
  {
    return this.x * 31 + this.y;
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == this)
      return true;
    if ((paramObject instanceof RSTile)) {
      RSTile localRSTile = (RSTile)paramObject;
      return (localRSTile.x == this.x) && (localRSTile.y == this.y) && (localRSTile.z == this.z);
    }
    return false;
  }

  public String toString()
  {
    return "(X: " + this.x + ", Y:" + this.y + ", Z:" + this.z + ")";
  }
}